// import Vue from 'vue'
// import VueRouter from 'vue-router'
// import Login from "@/views/Login"
// import Index from "@/views/Index"
// import Home from "@/views/Home";
// import Product from "@/views/Product";
// import Order from "@/views/Order";
// import About from "@/views/About";
// import Info from "@/views/Info";
// import Article from "@/components/Article";
// import Discuss from "@/components/Discuss";
// Vue.use(VueRouter)
//
// // const routes = [
// //   {
// //     path: '/',
// //     component: Login
// //   },
// //   {
// //     path: '/index',
// //     component: Index,
// //     children:[
// //       {
// //         path: 'home',
// //         component: Home
// //       },
// //       {
// //         path: '/',
// //         redir
// //       }
// //     ]
// //   }
// // ]
//
// const router = new VueRouter({
//   routes : [
//     {
//       path: '/',
//       component: Login
//     },
//     {
//       path: '/index',
//       component: Index,
//       children: [
//         {
//           path: '',
//           redirect: 'home'
//         },
//         {
//           path: 'home',
//           component: Home
//         },
//         {
//           path: 'product',
//           component: Product
//         },
//         {
//           path: 'order',
//           component: Order
//         },
//         {
//           path: 'about',
//           component: About,
//           children:[
//             {
//               path: '',
//               redirect: 'article/1'
//             },
//             {
//               path: 'article/1',
//               component: Article
//             },
//             {
//               path: 'discuss',
//               component: Discuss
//             }
//
//           ]
//         },
//         {
//           path: 'info',
//           component: Info
//         }
//
//       ]
//     }
//   ]
// })
//
// export default router
import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "@/views/Login"
import Index from "@/views/Index"
import Home from "@/views/Home";
import Product from "@/views/Product";
import Order from "@/views/Order";
import About from "@/views/About";
import Info from "@/views/Info";
import Article from "@/components/Article";
import Discuss from "@/components/Discuss";
import Guide from "@/views/Guide";
import Register from "@/views/Register";
Vue.use(VueRouter)


const router = new VueRouter({
  routes : [
    {
      path: '/',
      component: Login
    },
    {
      path: '/Register',
      component: Register
    },
    {
      path: '/index',
      component: Index,
      children: [
        {
          path: '',
          redirect: 'home'
        },
        {
          path: 'home',
          component: Home
        },
        {
          path: 'product',
          component: Product
        },
        {
          path: 'guide',
          component: Guide
        },
        {
          path: 'order',
          component: Order
        },
        {
          path: 'about',
          component: About,
          children: [
            {
              path: '',
              redirect: 'article/1'
            },
            {
              path: 'article/:id',
              component: Article
            },
            {
              path: 'discuss/:id',
              component: Discuss
            }
          ]
        },
        {
          path: 'info',
          component: Info
        }

      ]
    }
  ]
})

export default router
